package org.lds.message.center.admin.business.channel.converter;

import org.lds.message.center.admin.business.channel.entity.Channel;
import org.lds.message.center.admin.business.channel.model.response.ChannelBaseResponse;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class ChannelToBaseResponseConverter implements Converter<Channel, ChannelBaseResponse> {

    @Override
    public ChannelBaseResponse convert(Channel source) {
        return ChannelBaseResponse.builder()
                .id(source.getId())
                .type(source.getType())
                .name(source.getName())
                .desc(source.getDesc())
                .enable(source.getEnable())
                .creator(source.getCreator())
                .modifier(source.getModifier())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .build();
    }

}


